home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9648 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: rain.fr!news
  2. From: Fabien Bergeret <fbergeret@nahua.arcanet.fr>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: don't understand preprocessor ;-(
  5. Date: Tue, 12 Mar 96 16:39:14 WET
  6. Organization: CSI InterNetNews site
  7. Message-ID: <NEWTNews.826649000.10797.fbergeret@nahua.arcanet.fr>
  8. References: <4ha2ce$lsv@gwdu19.gwdg.de>
  9. NNTP-Posting-Host: nahua.arcanet.fr
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=US-ASCII
  12. X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
  13.  
  14.  
  15. > I want to modify an existing program and don't undertand the following
  16. > code:
  17. > #define __far
  18. > int __far x;
  19. > Hm, it looks very simpel, but why does a progammer define something
  20. > to put it infront of a variable? In the progam I want to modify most
  21. > variables including struct's and register-variables are declared with
  22. > this preprocessor-instruction. If you can explain the sense of souch an 
  23. > instruction, please send me an email.
  24.  
  25.     One interesting thing, when you program, is the portability of what 
  26. you program. It means that, when you move from an envirnement to another, you 
  27. have to modify as fewe things as possible. 
  28.     The idea of far pointers is not really common : it just exist on DOS 
  29. or Windows. It means that it you move your application to another platform, 
  30. the word far will have to disappear. It's probably what happened here : the 
  31. application as been written in DOS, using a Small Memory Model, and then have 
  32. moved to another configuration. The #define __far make the word __far 
  33. disappear as long as #undef __far is not written
  34.  
  35.